package com.controller;



import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping(value = "/page")//restController 将controller的mapping 和方法的mapping结合作为访问路径
public class UrlController{
	//花括号中的变量和方法中的参数对应绑定传参数
	//例如 /arrive/student/add
	@RequestMapping(value = "/arrive/{option}/{subject}/{pagename}")
	public ModelAndView arriveUrl
	(@PathVariable("option") String option,@PathVariable("subject") String subject,@PathVariable("pagename") String pagename) {
		return new ModelAndView("/"+option+"/"+subject+"/"+pagename);
	}
	
	 @RequestMapping("home")
	    public String index() {
	        return "index";
	 }

	

}
